<!-- 选择渠道 -->
<template>
  <div>
    <span>渠道 </span>
    <el-cascader
      :options="options"
      :props="props"
      collapse-tags
      clearable
      size="small"
      @change="handleChangeChannel">
   </el-cascader>
  </div>
</template>

<script>
import { gameChannelOpt } from '@/api/aboutOptions'

export default {
    data() {
      return {
        props: { multiple: true },
        options: []
      };
    },

    created(){
      this.getChannel()
    },

    methods: {
    // 获取渠道
    async getChannel() {
      const res = await gameChannelOpt()
      this.options = res.data.data.options
    },

    // 选中渠道
    handleChangeChannel(value) {
      let newValue = value.map(i=>i[i.length-1])
      this.$emit('channel-event',newValue)
    }
  }
  };
</script>


<style >

</style>